{extend name="home@common/home_layout" /}

{block name="title"}商品列表{/block}
{block name="style"}{/block}

{block name="content"}

	{include file="home@common/cur_local" /}
	
	<script src="__HOME_PATH__/js/search_goods.js"></script>
	<link href="__HOME_PATH__/css/layout.css" rel="stylesheet" type="text/css"/>
	<link rel="stylesheet" href="__HOME_PATH__/custom/css/search.css">
		
	<div class="wrapper nch-breadcrumb-layout">
		{if(!empty($nav_here) && is_array($nav_here))}
			<div class="nch-breadcrumb">
				{volist name="nav_here" id="value"}
					<span class="arrow">&gt;</span>
	 				<span class="sort-box"> 
		 				<a href="{:url('shop/Goods/goods_list', array('cate_id' => $value['curr_cate_id']))}" class="current">
		 					{$value['curr_cate_name']}<i class="drop-arrow"></i>
		 				</a> 
	
	  					<div class="sort-sub">
		   					{if (!empty($value['cate_array']) && is_array($value['cate_array']))}
			    				<ul>
							        {foreach $value['cate_array'] as $vc}
								  		{if($vc['gc_id']!=$value['curr_cate_id'])}
								        	<li>
								        		<a href="{:url('shop/Goods/goods_list', array('cate_id' => $vc['gc_id']))}">
								        			{$vc['gc_name']}
								        		</a>
								        	</li>
								        {/if}
							  		{/foreach}
						        </ul>
		    				{/if}
	  					</div>
	   				</span>
	   			{/volist}
	   		</div>
	   	{/if}
		<div class="clear"></div>
	</div>
	  	
	  	
	<div class="nch-container wrapper">
	
	 	<!-- 分类下的推荐商品 -->
	    <div id="gc_goods_recommend_div" class="wrapper"></div>
	    <div class="nch-module">
	      	<div class="title">
	        	<h3>
	          		{if (!empty($show_keyword))}
	          			<em>{$show_keyword}</em> -
	          		{/if}
	          		商品筛选<i>搜索到{$goods_num}件相关商品</i>
	          	</h3>
	      	</div>
			<div class="content">
	        	<div class="nch-module-filter">	
					<dl>
	            		<dt><span>商品所在地：</span></dt>
	            		<dd class="list">
	              			<ul>
					            {if($flag == 0)}
					                <li><a href="{:FU_replace_param(array('areaid_1' => 0))}">全国</a> </li>
					                {volist name="province" id="value"}
					                  	<li><a href="{:FU_replace_param(array('areaid_1' => $value['area_id']))}"> {$value['area_name']}</a>  </li>
					                {/volist}
					            {else /}
						      		<li><a href="{:FU_replace_param(array('areaid_1' => 0))}">不限</a> </li>
					                <li><a href="{:FU_replace_param(array('areaid_3' => 0))}">全市</a> </li>
					                {volist name="city_list" id="$value"}
					                  	<li><a href="{:FU_replace_param(array('areaid_3' => $value['area_id']))}"> {$value['area_name']}</a>  </li>
					                {/volist}
					            {/if}
					        </ul>
	            		</dd>  
	          		</dl>
	    			{php} $dl=1; {/php}
	    			{if((!empty($brand_array) && is_array($brand_array)) || (!empty($attr_array) && is_array($attr_array)))}
		          		{if((isset($checked_brand) && is_array($checked_brand)) || (isset($checked_attr) && is_array($checked_attr)))}
					        <dl nc_type="ul_filter">
					            <dt>您已选择：</dt>
					            <dd class="list">
					              	{if(isset($checked_brand) && is_array($checked_brand))}
						              	{foreach $checked_brand as $key=>$val}
						              		<span class="selected" nctype="span_filter">
						              			品牌:<em>{$val['brand_name']}</em><i data-uri="{:url('shop/Brand/index',array('b_id' => $key))}">X</i>
						              		</span>
						              	{/foreach}
					              	{/if}
					              	{if(isset($checked_attr) && is_array($checked_attr))}
						              	{foreach $checked_attr as $val}
						              		<span class="selected" nctype="span_filter">
						              			{$val['attr_name']}:<em>{$val['attr_value_name']}</em><i data-uri="{:url('shop/Att/index',array('a_id' => $val['attr_value_id']))}">X</i>
						              		</span>
						              	{/foreach}
					              	{/if}
					            </dd>
					        </dl>
		          		{/if}
		          		
		          		{if (!isset($checked_brand) || empty($checked_brand))}
		          			{if(!empty($brand_array) && is_array($brand_array))}
						        <dl>
						            <dt>品牌:</dt>
						            <dd class="list">
							            <ul class="nch-brand-tab" nctype="ul_initial" style="display:none;">
							                <li data-initial="all">
							                	<a href="javascript:void(0);">所有品牌<i class="arrow"></i></a>
							                </li>
							                {if (!empty($initial_array))}
							                {foreach $initial_array as $val}
							                	<li data-initial="{$val}">
							                		<a href="javascript:void(0);">{$val}<i class="arrow"></i></a>
							                	</li>
							                {/foreach}
							                {/if}
							            </ul>
						              	<div id="ncBrandlist">
							                <ul class="nch-brand-con" nctype="ul_brand">
							                	{volist name="brand_array" id="v"}
							                  		<li data-initial="{$v['brand_initial']}" {if ($i > 14)} style="display:none;"{/if}>
							                  			<a href="{if ($_GET['b_id'] != '' && intval($_GET['b_id']) != 0) }{:url('shop/Brand/detail',array('b_id' => $_GET['b_id'].'_'.$key))}{else /}{:url('shop/Brand/detail',array('b_id' => $key))}{/if}">
									                    	{if ($v['show_type'] == 0)}
									                    		<img src="__UPLOAD_PATH__/shop/brand/{$v['brand_pic']}" alt="{$v['brand_name']}" /> 
									                    		<span>{$v['brand_name']}</span>
									                    	{else /}
									                    		{$v['brand_name']}
									                    	{/if}
							                    		</a>
							                    	</li>
							                  	{/volist}
							                </ul>
						              	</div>
						            </dd>
						            {if (count($brand_array) > 16)}
						            <dd class="all">
						            	<span nctype="brand_show">
						            		<i class="icon-angle-down"></i>更多
						            	</span>
						            </dd>
						            {/if}
						        </dl>
			          		{$dl++}
			          		{/if}
		          		{/if}
		          		
		          		{if (!empty($attr_array) && is_array($attr_array))}
		          			{foreach $attr_array as $val}
		          				{if(!isset($checked_attr[$key]) && !empty($val['value']) && is_array($val['value']))}
						        <dl>
						            <dt>{$val['name']}：</dt>
						            <dd class="list">
						              	<ul>
						              		{volist name="val['value']" id="v" key="m"}
							                	<li {if ($m>10)}style="display:none" nc_type="none"{/if}><a href="{if ($_GET['a_id'] != '' && intval($_GET['a_id']) != 0) }{:url('shop/Goods/goods_detail',array('b_id' => $_GET['a_id'].'_'.$key))}{else /}{:url('shop/Goods/goods_detail',array('a_id' => $key))}{/if}">{$v['attr_value_name']}</a></li>
							                {/volist}
						              	</ul>
						            </dd>
						            {if (count($val['value']) > 10)}
						            	<dd class="all">
						            		<span nc_type="show">
						            			<i class="icon-angle-down"></i>更多
						            		</span>
						            	</dd>
						            {/if}
						        </dl>
					    	{foreach}
					    	{php} $dl++; {/php}
					    {/if}
				   	{/if}
	        	</div>
	      	</div>
	      	
	 	</div>
	 
	 
	  	<div class="left">
	    	{if (!empty($goods_class_array))}
		    	<div class="nch-module nch-module-style02">
				    <div class="title">
				        <h3>分类筛选</h3>
				    </div>
		      		<div class="content">
				        <ul id="files" class="tree">
				          	{foreach $goods_class_array as $value}
					          	<li>
					          		<i class="tree-parent tree-parent-collapsed"></i>
					          		<a href="{:url('shop/Goods/goods_list',array('cate_id' => $value['gc_id'], 'keyword' => $_GET['keyword']))}" {if ($value['gc_id'] == $_GET['cate_id'])} class="selected"{/if}>{$value['gc_name']}</a>
						            {if (!empty($value['class2']))}
							            <ul>
							              	{foreach $value['class2'] as $val}
								              	<li>
									              	<i class="tree-parent tree-parent-collapsed"></i>
									              	<a href="{:url('shop/Goods/goods_list',array('cate_id' => $val['gc_id'], 'keyword' => $_GET['keyword']))}" {if ($val['gc_id'] == $_GET['cate_id'])}class="selected"{/if}>{$val['gc_name']}</a>
									                {if (!empty($val['class3']))}
										                <ul>
										                  {foreach ($val['class3'] as $v}
										                  	<li class="tree-parent tree-parent-collapsed">
										                  		<i></i>
										                  		<a href="{:url('shop/Goods/goods_list',array('cate_id' => $v['gc_id'], 'keyword' => $_GET['keyword']))}" {if ($v['gc_id'] == $_GET['cate_id'])} class="selected"{/if}>{$v['gc_name']}</a></li>
										                  {/foreach}
										                </ul>
									                {/if}
								              	</li>
							              	{/foreach}
							            </ul>
						            {/if}
					          	</li>
				          	{/foreach}
				        </ul>
		      		</div>
		   		</div>
	    	{/if}
	    	<!-- S 推荐展位 -->
	    	<div nctype="booth_goods" class="nch-module" style="display:none;"> </div>
	    	<!-- E 推荐展位 -->
	    	<!--<div class="nch-module">loadadv(37,'html')</div>-->
	    	<!-- 最近浏览 -->
	    
	    	<div class="nch-module nch-module-style03">
			    <div class="title">
			        <h3>最近浏览</h3>
			    </div>
	      		<div class="content">
			        <div class="nch-sidebar-viewed" id="nchSidebarViewed">
			          	<ul>
				            {if(!empty($viewed_goods) && is_array($viewed_goods))}
					            {foreach ($viewed_goods as $k=>$v)}
						            <li class="nch-sidebar-bowers">
						              	<div class="goods-pic">
						              		<a href="{:url('shop/Goods/goods_detail',array('goods_id'=>$v['goods_id']))}" target="_blank">
						              			<img src="__UPLOAD_PATH__/shop/common/loading.gif" rel="lazy" data-url="{thumb($v, 60)}" title="{$v['goods_name']}" alt="{$v['goods_name']}" >
						              		</a>
						              	</div>
						              	<dl>
						                	<dt><a href="{:url('shop/Goods/goods_detail',array('goods_id'=>$v['goods_id']))}" target="_blank">{$v['goods_name']}</a></dt>
						                	<dd>￥{$v['goods_promotion_price']}</dd>
						              	</dl>
						            </li>
					            {/foreach}
				            {/if}
			          	</ul>
			        </div>
			        <a href="{:url('member/Goodsbrowse/index')}" class="nch-sidebar-all-viewed">全部浏览历史</a></div>
	    		</div>
	  		</div>
			<style type="text/css">
			  	.goods-list-nav .category .menu li .recommend-class{
			  		display: none;
			  	}
			</style>
	  		<div class="right"> 
	
		    	<div class="shop_con_list" id="main-nav-holder">
			      	<nav class="sort-bar" id="main-nav">
			        	<div class="pagination">{$show_page1} </div>
				        <div class="nch-all-category">
				          	<div class="all-category goods-list-nav">
				          		{include file="common/all_nav" /}
				          	</div>
				        </div>
				        <div class="nch-sortbar-array"> 排序方式：
				          	<ul>
				            	<li {if(!$_GET['key'])}class="selected"{/if}><a href="{dropParam(array('order', 'key'))}"  title="默认排序">默认</a></li>
				            	<li {if($_GET['key'] == '1')}class="selected"{/if}><a href="{($_GET['order'] == '2' && $_GET['key'] == '1') ? replaceParam(array('key' => '1', 'order' => '1')):replaceParam(array('key' => '1', 'order' => '2'));}" {if($_GET['key'] == '1')}class="{$_GET['order'] == 1 ? 'asc' : 'desc';}"{/if} title="<?php echo ($_GET['order'] == '2' && $_GET['key'] == '1')?$lang['goods_class_index_sold_asc']:$lang['goods_class_index_sold_desc']; ?>"><?php echo $lang['goods_class_index_sold'];?><i></i></a></li>
				            	<li {if($_GET['key'] == '2')}class="selected"{/if}><a href="{($_GET['order'] == '2' && $_GET['key'] == '2') ? replaceParam(array('key' => '2', 'order' => '1')):replaceParam(array('key' => '2', 'order' => '2'));}" {if($_GET['key'] == '2')}class="{$_GET['order'] == 1 ? 'asc' : 'desc';}"{/if} title="<?php  echo ($_GET['order'] == '2' && $_GET['key'] == '2')?$lang['goods_class_index_click_asc']:$lang['goods_class_index_click_desc']; ?>"><?php echo $lang['goods_class_index_click']?><i></i></a></li>
				            	<li {if($_GET['key'] == '3')}class="selected"{/if}><a href="{($_GET['order'] == '2' && $_GET['key'] == '3') ? replaceParam(array('key' => '3', 'order' => '1')):replaceParam(array('key' => '3', 'order' => '2'));}" {if($_GET['key'] == '3')}class="{$_GET['order'] == 1 ? 'asc' : 'desc';}"{/if} title="<?php echo ($_GET['order'] == '2' && $_GET['key'] == '3')?$lang['goods_class_index_price_asc']:$lang['goods_class_index_price_desc']; ?>"><?php echo $lang['goods_class_index_price'];?><i></i></a></li>
				          	</ul>
				        </div>
				        <div class="nch-sortbar-filter" nc_type="more-filter">
				        	<span class="arrow"></span>
					        <ul>
					            <li><a href="{if ($_GET['type'] == 1)} {dropParam(array('type'))} {else /} {replaceParam(array('type' => '1'))}{/if}" {if ($_GET['type'] == 1)}class="selected"{/if}><i></i>平台自营</a></li>
					            <li><a href="{if ($_GET['gift'] == 1)} {dropParam(array('gift'))} {else /} {replaceParam(array('gift' => '1'))}{/if}" {if ($_GET['gift'] == 1)}class="selected"{/if}><i></i>赠品</a></li>
					            <!-- 消费者保障服务 -->
					            {if $contract_item}
						            {foreach $contract_item as $citem_k => $citem_v}
						            	<li><a href="{if (in_array($citem_k,$search_ci_arr))} {removeParam(array('ci' => $citem_k))} {else /} {replaceParam(array('ci' => $search_ci_str.$citem_k))}{/if}" {if (in_array($citem_k,$output['search_ci_arr']))}class="selected"{/if}><i></i>{$citem_v['cti_name']}</a></li>
						            {/foreach}
					            {/if}
					        </ul>
				        </div>
				        <div class="nch-sortbar-location">商品所在地：
				          	<div class="select-layer">
					            <div class="holder"><em nc_type="area_name">所在地</em></div>
					            <div class="selected"><a nc_type="area_name">所在地</a></div>
					            <i class="direction"></i>
					            <ul class="options">
					              <!--/home/goods_class_area.php')-->
					            </ul>
				          	</div>
				        </div>
			      	</nav>
		      		<!-- 商品列表循环  -->
			      	<div>
			      		{include file="goods/goods_squares" /}
			      	</div>
				    <div class="tc mt20 mb20">
				        <div class="pagination"> {$show_page} </div>
				    </div>
		    	</div>
	    
	    		<!-- 猜你喜欢 -->
	    		<div id="guesslike_div" style="width:980px;"></div>
	  		</div>
	  		<div class="clear"></div>
		</div>
		<script src="__RESOURCE_PATH__/js/waypoints.js"></script> 
		<script src="__HOME_PATH__/js/search_category_menu.js"></script> 
		<script type="text/javascript" src="__RESOURCE_PATH__/js/fly/jquery.fly.min.js" charset="utf-8"></script> 
		<!--[if lt IE 10]>
		<script type="text/javascript" src="__RESOURCE_PATH__/js/fly/requestAnimationFrame.js" charset="utf-8"></script>
		<![endif]-->
		<script type="text/javascript">
			var defaultSmallGoodsImage = '__DEFAULT_PATH__/default_goods_image_240.gif';
			var defaultTinyGoodsImage = '__DEFAULT_PATH__/default_goods_image_60.gif';
	
			$(function(){
			    $('#files').tree({
			        expanded: 'li:lt(2)'
			    });
				//品牌索引过长滚条
				$('#ncBrandlist').perfectScrollbar({suppressScrollX:true});
			    //浮动导航  waypoints.js
			    $('#main-nav-holder').waypoint(function(event, direction) {
			        $(this).parent().toggleClass('sticky', direction === "down");
			        event.stopPropagation();
			    });
				// 单行显示更多
				$('span[nc_type="show"]').click(function(){
					s = $(this).parents('dd').prev().find('li[nc_type="none"]');
					if(s.css('display') == 'none'){
						s.show();
						$(this).html('<i class="icon-angle-up"></i>点击折叠收起');
					}else{
						s.hide();
						$(this).html('<i class="icon-angle-down"></i>点击展开全部');
					}
				});
		
				{if(isset($_GET['area_id']) && intval($_GET['area_id']) > 0)}
			  		// 选择地区后的地区显示
			  		$('[nc_type="area_name"]').html('{$province_array[intval($_GET['area_id'])]}');
				{/if}
			
				{if(isset($_GET['cate_id']) && intval($_GET['cate_id']) > 0)}
					// 推荐商品异步显示
			    	$('div[nctype="booth_goods"]').load('{:url("shop/Goods/get_booth_goods",array('cate_id' => $_GET['cate_id']))}', function(){
			       	 	$(this).show();
			   	 	});
				{/if}
				//浏览历史处滚条
				$('#nchSidebarViewed').perfectScrollbar({suppressScrollX:true});
		
				//猜你喜欢
				$('#guesslike_div').load('{:url("shop/Goods/get_guesslike")}', function(){
			        $(this).show();
			    });
		
				//商品分类推荐
				$('#gc_goods_recommend_div').load('{:url("shop/Goods/get_gc_goods_recommend",array('cate_id'=>$default_classid))}');
			});
		</script> 
	

{/block}

{block name="script"}{/block}